﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Openfree.Workflow.Common;

public partial class PMSWeb_DesktopWorkflow : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DataSet ds = WorkflowManager.LoadWaitingWorkflow(SessionManager.UserID, OrgTreeAccess.TREE_XINGZHENG,
            OrgTreeAccess.GetQueryCode(SessionManager.UserID, OrgTreeAccess.TREE_XINGZHENG));

            StringBuilder sbTemp = new StringBuilder();
            int index = 1;
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                sbTemp.AppendLine("<tr>");
                sbTemp.AppendLine("<td><img src=\"../App_Themes/DefaultSkin/Image/da" + index.ToString() + ".jpg\" alt=\"" + index.ToString() + "\" ></td>");
                sbTemp.AppendLine("<td>" + row["GroupCodeName"].ToString() + " - " + row["CategorySubject"].ToString() + "</td>");
                sbTemp.AppendLine("<td><a target='_parent' href='#'>" + row["Subject"].ToString() + "</a></td>");
                sbTemp.AppendLine("<td>" + row["Username"].ToString() + "</td>");
                sbTemp.AppendLine("<td>" + Convert.ToDateTime(row["CreateDate"].ToString()).ToString("MM-dd") + "</td>");
                sbTemp.AppendLine("<tr>");
                index++;
            }

            for (int i = index; i < 8; i++)
            {
                sbTemp.AppendLine("<tr>");
                sbTemp.AppendLine("<td>&nbsp;</td>");
                sbTemp.AppendLine("<td>&nbsp;</td>");
                sbTemp.AppendLine("<td>&nbsp;</td>");
                sbTemp.AppendLine("<td>&nbsp;</td>");
                sbTemp.AppendLine("<td>&nbsp;</td>");
                sbTemp.AppendLine("<tr>");
            }

            literal.Text = sbTemp.ToString();
        }
    }
}